DIR=testcases/
testcases=(mytestcase1 mytestcase2 mytestcase3 mytestcase4 mytestcase5 mytestcase6 mytestcase7 mytestcase8 mytestcase9 mytestcase10 mytestcase11 mytestcase12 mytestcase13)

cc -fprofile-arcs -ftest-coverage -o ymirdb ymirdb.c -D AUTOTEST

for element in ${testcases[@]}
do
    test_path="${DIR}${element}.txt"
    solution_path="${DIR}${element}_solution.txt"
    echo "--------------------------------------"
    ./ymirdb < ${test_path}  > testcases/res
    diff testcases/res ${solution_path}
    if [[ "$?" -eq "0" ]];then
		echo "${element} pass"
	else
		echo "${element} fail"
    fi
    echo "--------------------------------------"
    echo
    
done

gcov ymirdb.c